package InterfaceAppliesToOlderVersion;

public class Adapter implements NewInterface{
    private final OldClass oldClass;

    public Adapter(OldClass oldClass) {
        this.oldClass = oldClass;
    }

    @Override
    public void newMethod() {
        // 在新方法中调用旧方法
        oldClass.oldMethod();
    }
}
